package com.mdd.service.impl;

import com.mdd.domain.Book;
import com.mdd.mapper.BookMapper;
import com.mdd.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookMapper bookMapper;

    public List<Book> selectAll() {
        System.out.println("业务层正在处理查询所有业务");
        return bookMapper.selectAll();
    }


    public Integer addBook(Book book) {
        System.out.println("业务层正在处理添加业务");
        return bookMapper.addBook(book);
    }


    public Book selectById(int id) {
        System.out.println("业务层正在处理查询单个业务");
        return bookMapper.selectById(id);
    }

    public Integer updateById(Book book) {
        System.out.println("业务层正在处理修改业务");
        return bookMapper.updateById(book);
    }


    public Integer deleteById(int id) {
        System.out.println("业务层正在处理删除业务");
        return bookMapper.deleteById(id);
    }

}
